<template>
    <div>
        <van-date-picker
            v-model="currentDate"
            title="选择日期"
            :min-date="minDate"
            :max-date="maxDate"
            @cancel="$emit('close')"
            @confirm="onConfirm"
        />
    </div>
</template>
<script>
export default {
    data() {
        return {
            minDate: new Date(2020, 0, 1),
            maxDate: new Date(2025, 5, 1),
            currentDate:[2020, 0, 1],
        }
    },
    methods: {
        onConfirm(e) {
            console.log(e);
            const {selectedValues} = e
            const value = selectedValues[0] + '-' + selectedValues[1] + '-' + selectedValues[2]
            this.$emit('close')
            this.$emit('update-birthday',value);
        }
    }
}
</script>
<style lang="">
    
</style>